let query = require("./db").query;
let queryWithPromise = require("./db").queryWithPromise;
// let sql = "SELECT * from myshop.user where user_id=?";
// let values = [1]
//let sql = "SELECT * from myshop.user where username=? and password =?";
// let values = [1]
// let sql = "select * from user_role where user_id = ?";

// query(sql,values,function(err,results){
//     console.log(results);
//     console.log(results.length)
//     console.log(results[0].role_id);
// })
let values = [1];
// let sql = "select * from user_role where user_id = ?";
let sql_city_count = 'select count(*) from city';
async function test() {
  let { results } = await queryWithPromise(sql_city_count, []);
  console.log("Promise 查询出来的结果:",results);
}
test();
// SELECT * from myshop.city LIMIT 0,20; 分页的语句